// 导入包
import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcartContainer from './components/tabbar/ShopcartContainer.vue'
import Newslist from './components/news/Newslist.vue'
import NewInfo from './components/news/NewInfo.vue'
import Photolist from './components/photos/Photolist.vue'
import PhotoInfo from './components/photos/PhotoInfo.vue'
import GoodsList from './components/goods/GoodsList.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodsDesc from './components/goods/GoodsDesc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'

// 创建路由对象
var router = new VueRouter({
    routes: [
        {
            path: "/",
            redirect: "/home"
        },
        {
            path: '/home',
            component: HomeContainer
        },
        {
            path: '/member',
            component: MemberContainer
        },
        {
            path: '/showcart',
            component: SearchContainer
        },
        {
            path: '/search',
            component: ShopcartContainer
        },
        {
            path: '/home/newslist',
            component: Newslist
        },
        {
            path: '/home/newsinfo/:id',
            component: NewInfo
        },
        {
            path: '/home/photolist',
            component: Photolist
        },
        {
            path: '/home/photoinfo/:id',
            component: PhotoInfo
        },
        {
            path: '/home/goodslist',
            component: GoodsList
        },
        {
            path: '/home/goodsInfo/:id',
            component: GoodsInfo,
            name: 'goodsInfo'
        },
        {
            path: '/home/goodsDesc/:id',
            component: GoodsDesc,
            name: 'goodsdesc'
        },
        {
            path: '/home/goodsComment/:id',
            component: GoodsComment,
            name: 'goodscomment'
        }
    ],
    // 覆盖默认的路由高亮的类
    linkActiveClass: 'mui-active'
});

// 把路由对象暴露出去
export default router;